/*
 * Copyright © 2024-2025 Wenze Wei
 *
 * This file is part of StadionOS.
 *
 * This Source Code Form is subject to the terms of the GNU General Public License, v. 2.0.
 * You can obtain a copy of the GPL at
 * https://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
 * the specific language governing rights and limitations under the License.
 */

#ifndef STADIONOS_OUTPUT_H
#define STADIONOS_OUTPUT_H

#include <stdio.h>
#include <wlr/util/log.h>
#include <wlr/types/wlr_output.h>
#include "compositor.h"

typedef struct onatu_output {
    struct {
        int logical_x;
        int logical_y;
        float scale_factor;
        uint32_t refresh_rate;
        bool primary;
    } display_config;
    struct wlr_gl_context_config gl_config;
    struct wlr_output *wlr_output;
    struct wl_listener frame;
    struct wl_list link;
    struct onatu_compositor *compositor;
    struct wlr_scene_output *scene_output;
    int x, y;
    struct wlr_box effective_area;
    struct wl_list linked_outputs;
} onatu_output;

void output_init(struct onatu_output *output, struct wlr_output *wlr_output,
                 struct wlr_allocator *allocator, struct wlr_renderer *renderer,
                 struct onatu_compositor *compositor);

#endif // STADIONOS_OUTPUT_H